<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <!-- <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="消防员姓名" prop="firefighterName">
        <el-input
          v-model="queryParams.firefighterName"
          placeholder="请输入消防员姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="单一人三盘水带连接" prop="fireProgram">
        <el-input
          v-model="queryParams.fireProgram"
          placeholder="请输入单一人三盘水带连接"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="沿拉梯铺设水带" prop="fireProgram1">
        <el-input
          v-model="queryParams.fireProgram1"
          placeholder="请输入沿拉梯铺设水带"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="垂直铺设水带" prop="fireProgram2">
        <el-input
          v-model="queryParams.fireProgram2"
          placeholder="请输入垂直铺设水带"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="狭小空间铺设水带" prop="fireProgram3">
        <el-input
          v-model="queryParams.fireProgram3"
          placeholder="请输入狭小空间铺设水带"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="吸水管连接" prop="fireProgram4">
        <el-input
          v-model="queryParams.fireProgram4"
          placeholder="请输入吸水管连接"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="射水技术" prop="fireProgram5">
        <el-input
          v-model="queryParams.fireProgram5"
          placeholder="请输入射水技术"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="攀登挂钩梯上四楼" prop="fireProgram6">
        <el-input
          v-model="queryParams.fireProgram6"
          placeholder="请输入攀登挂钩梯上四楼"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="攀登单杠梯" prop="fireProgram7">
        <el-input
          v-model="queryParams.fireProgram7"
          placeholder="请输入攀登单杠梯"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="两人五盘水带连接" prop="fireProgram8">
        <el-input
          v-model="queryParams.fireProgram8"
          placeholder="请输入两人五盘水带连接"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="干线水带更换" prop="fireProgram9">
        <el-input
          v-model="queryParams.fireProgram9"
          placeholder="请输入干线水带更换"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="楼层吊升水带" prop="fireProgram10">
        <el-input
          v-model="queryParams.fireProgram10"
          placeholder="请输入楼层吊升水带"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="水带登高伸长" prop="fireProgram11">
        <el-input
          v-model="queryParams.fireProgram11"
          placeholder="请输入水带登高伸长"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="垂直更换水带" prop="fireProgram12">
        <el-input
          v-model="queryParams.fireProgram12"
          placeholder="请输入垂直更换水带"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="水枪前延长水带" prop="fireProgram13">
        <el-input
          v-model="queryParams.fireProgram13"
          placeholder="请输入水枪前延长水带"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="分水器前延长水带" prop="fireProgram14">
        <el-input
          v-model="queryParams.fireProgram14"
          placeholder="请输入分水器前延长水带"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="录入时间" prop="entryDate">
        <el-date-picker clearable
          v-model="queryParams.entryDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择录入时间">
        </el-date-picker>
      </el-form-item>
      <!-- <el-form-item label="三盘水带连接" prop="fireProgram15">
        <el-input
          v-model="queryParams.fireProgram15"
          placeholder="请输入三盘水带连接"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="纵深灭火操" prop="fireProgram16">
        <el-input
          v-model="queryParams.fireProgram16"
          placeholder="请输入纵深灭火操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车辆驾驶" prop="fireProgram17">
        <el-input
          v-model="queryParams.fireProgram17"
          placeholder="请输入车辆驾驶"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="地下有限空间救援操" prop="fireProgram18">
        <el-input
          v-model="queryParams.fireProgram18"
          placeholder="请输入地下有限空间救援操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="百米障碍救助操" prop="fireProgram19">
        <el-input
          v-model="queryParams.fireProgram19"
          placeholder="请输入百米障碍救助操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="信息综合查询操" prop="fireProgram20">
        <el-input
          v-model="queryParams.fireProgram20"
          placeholder="请输入信息综合查询操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="拉梯与钩梯联用操" prop="fireProgram21">
        <el-input
          v-model="queryParams.fireProgram21"
          placeholder="请输入拉梯与钩梯联用操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车辆操作" prop="fireProgram22">
        <el-input
          v-model="queryParams.fireProgram22"
          placeholder="请输入车辆操作"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="十五米拉梯架设操" prop="fireProgram23">
        <el-input
          v-model="queryParams.fireProgram23"
          placeholder="请输入十五米拉梯架设操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="枪炮协同操" prop="fireProgram24">
        <el-input
          v-model="queryParams.fireProgram24"
          placeholder="请输入枪炮协同操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="片图绘制" prop="fireProgram25">
        <el-input
          v-model="queryParams.fireProgram25"
          placeholder="请输入片图绘制"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="60米肩梯架设操" prop="fireProgram26">
        <el-input
          v-model="queryParams.fireProgram26"
          placeholder="请输入60米肩梯架设操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="绳结制作操" prop="fireProgram27">
        <el-input
          v-model="queryParams.fireProgram27"
          placeholder="请输入绳结制作操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="三盘水带连接操" prop="fireProgram28">
        <el-input
          v-model="queryParams.fireProgram28"
          placeholder="请输入三盘水带连接操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="楼层火灾内攻操" prop="fireProgram29">
        <el-input
          v-model="queryParams.fireProgram29"
          placeholder="请输入楼层火灾内攻操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="挂钩提上四楼" prop="fireProgram30">
        <el-input
          v-model="queryParams.fireProgram30"
          placeholder="请输入挂钩提上四楼"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车辆引导" prop="fireProgram31">
        <el-input
          v-model="queryParams.fireProgram31"
          placeholder="请输入车辆引导"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="无人机侦察操" prop="fireProgram32">
        <el-input
          v-model="queryParams.fireProgram32"
          placeholder="请输入无人机侦察操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="地下有限空间救人操" prop="fireProgram33">
        <el-input
          v-model="queryParams.fireProgram33"
          placeholder="请输入地下有限空间救人操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车载炮出水" prop="fireProgram34">
        <el-input
          v-model="queryParams.fireProgram34"
          placeholder="请输入车载炮出水"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="四节吸水管连接操" prop="fireProgram35">
        <el-input
          v-model="queryParams.fireProgram35"
          placeholder="请输入四节吸水管连接操"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:FirefighterFireTable:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:FirefighterFireTable:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:FirefighterFireTable:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:FirefighterFireTable:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="FirefighterFireTableList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <!-- <el-table-column label="用户ID" align="center" prop="userId" /> -->
      <el-table-column label="消防员姓名" align="center" prop="firefighterName" />
      <el-table-column label="单一人三盘水带连接" align="center" prop="fireProgram" />
      <el-table-column label="沿拉梯铺设水带" align="center" prop="fireProgram1" />
      <el-table-column label="垂直铺设水带" align="center" prop="fireProgram2" />
      <el-table-column label="狭小空间铺设水带" align="center" prop="fireProgram3" />
      <el-table-column label="吸水管连接" align="center" prop="fireProgram4" />
      <el-table-column label="射水技术" align="center" prop="fireProgram5" />
      <el-table-column label="攀登挂钩梯上四楼" align="center" prop="fireProgram6" />
      <el-table-column label="攀登单杠梯" align="center" prop="fireProgram7" />
      <el-table-column label="两人五盘水带连接" align="center" prop="fireProgram8" />
      <el-table-column label="干线水带更换" align="center" prop="fireProgram9" />
      <el-table-column label="楼层吊升水带" align="center" prop="fireProgram10" />
      <el-table-column label="水带登高伸长" align="center" prop="fireProgram11" />
      <el-table-column label="垂直更换水带" align="center" prop="fireProgram12" />
      <el-table-column label="水枪前延长水带" align="center" prop="fireProgram13" />
      <el-table-column label="分水器前延长水带" align="center" prop="fireProgram14" />
      
      <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
      <el-table-column label="三盘水带连接" align="center" prop="fireProgram15" />
      <el-table-column label="纵深灭火操" align="center" prop="fireProgram16" />
      <el-table-column label="车辆驾驶" align="center" prop="fireProgram17" />
      <el-table-column label="地下有限空间救援操" align="center" prop="fireProgram18" />
      <el-table-column label="百米障碍救助操" align="center" prop="fireProgram19" />
      <el-table-column label="信息综合查询操" align="center" prop="fireProgram20" />
      <el-table-column label="拉梯与钩梯联用操" align="center" prop="fireProgram21" />
      <el-table-column label="车辆操作" align="center" prop="fireProgram22" />
      <el-table-column label="十五米拉梯架设操" align="center" prop="fireProgram23" />
      <el-table-column label="枪炮协同操" align="center" prop="fireProgram24" />
      <el-table-column label="片图绘制" align="center" prop="fireProgram25" />
      <el-table-column label="60米肩梯架设操" align="center" prop="fireProgram26" />
      <el-table-column label="绳结制作操" align="center" prop="fireProgram27" />
      <el-table-column label="三盘水带连接操" align="center" prop="fireProgram28" />
      <el-table-column label="楼层火灾内攻操" align="center" prop="fireProgram29" />
      <el-table-column label="挂钩提上四楼" align="center" prop="fireProgram30" />
      <el-table-column label="车辆引导" align="center" prop="fireProgram31" />
      <el-table-column label="无人机侦察操" align="center" prop="fireProgram32" />
      <el-table-column label="地下有限空间救人操" align="center" prop="fireProgram33" />
      <el-table-column label="车载炮出水" align="center" prop="fireProgram34" />
      <el-table-column label="四节吸水管连接操" align="center" prop="fireProgram35" />
      <el-table-column label="录入时间" align="center" prop="entryDate" width="180" fixed="right">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.entryDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:FirefighterFireTable:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:FirefighterFireTable:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改灭火救援岗位技能科目训练登记对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <!-- <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item> -->
        <el-form-item label="消防员证件号" prop="firefighterIdCard">
          <el-input v-model="form.firefighterIdCard" placeholder="请输入消防员证件号" @change="getDynamicInput" />
        </el-form-item>
        <el-form-item label="消防员姓名" prop="firefighterName">
          <el-input v-model="form.firefighterName" placeholder="请输入消防员姓名" />
        </el-form-item>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '单一人三盘水带连接'">
          <el-form-item label="单一人三盘水带连接" prop="fireProgram" >
            <el-input v-model="form.fireProgram" placeholder="请输入（数字类型）成绩" />
          </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '沿拉梯铺设水带'">
          <el-form-item label="沿拉梯铺设水带" prop="fireProgram1" >
            <el-input v-model="form.fireProgram1" placeholder="请输入（数字类型）成绩" />
          </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '垂直铺设水带'">
          <el-form-item label="垂直铺设水带" prop="fireProgram2" >
          <el-input v-model="form.fireProgram2" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '狭小空间铺设水带'">
          <el-form-item label="狭小空间铺设水带" prop="fireProgram3" >
            <el-input v-model="form.fireProgram3" placeholder="请输入（数字类型）成绩" />
          </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '吸水管连接'">
          <el-form-item label="吸水管连接" prop="fireProgram4">
            <el-input v-model="form.fireProgram4" placeholder="请输入（数字类型）成绩" />
          </el-form-item>
        </div>


        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '射水技术'">
          <el-form-item label="射水技术" prop="fireProgram5">
          <el-input v-model="form.fireProgram5" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '攀登挂钩梯上四楼'">
          <el-form-item label="攀登挂钩梯上四楼" prop="fireProgram6">
          <el-input v-model="form.fireProgram6" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '攀登单杠梯'">
          <el-form-item label="攀登单杠梯" prop="fireProgram7">
          <el-input v-model="form.fireProgram7" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>


        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '两人五盘水带连接'">
          <el-form-item label="两人五盘水带连接" prop="fireProgram8">
          <el-input v-model="form.fireProgram8" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '干线水带更换'">
          <el-form-item label="干线水带更换" prop="fireProgram9">
          <el-input v-model="form.fireProgram9" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '楼层吊升水带'">
          <el-form-item label="楼层吊升水带" prop="fireProgram10">
          <el-input v-model="form.fireProgram10" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '水带登高伸长'">
          <el-form-item label="水带登高伸长" prop="fireProgram11">
          <el-input v-model="form.fireProgram11" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '垂直更换水带'">
          <el-form-item label="垂直更换水带" prop="fireProgram12">
          <el-input v-model="form.fireProgram12" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '水枪前延长水带'">
          <el-form-item label="水枪前延长水带" prop="fireProgram13">
          <el-input v-model="form.fireProgram13" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '分水器前延长水带'">
          <el-form-item label="分水器前延长水带" prop="fireProgram14">
          <el-input v-model="form.fireProgram14" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '三盘水带连接'">
          <el-form-item label="三盘水带连接" prop="fireProgram15">
          <el-input v-model="form.fireProgram15" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '纵深灭火操'">
          <el-form-item label="纵深灭火操" prop="fireProgram16">
          <el-input v-model="form.fireProgram16" placeholder="请输入请输入（优秀/良好/合格）" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '车辆驾驶'">
          <el-form-item label="车辆驾驶" prop="fireProgram17">
          <el-input v-model="form.fireProgram17" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '地下有限空间救援操'">
          <el-form-item label="地下有限空间救援操" prop="fireProgram18">
          <el-input v-model="form.fireProgram18" placeholder="请输入（优秀/良好/合格）"  />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '百米障碍救助操'">
          <el-form-item label="百米障碍救助操" prop="fireProgram19">
          <el-input v-model="form.fireProgram19" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '信息综合查询操'">
          <el-form-item label="信息综合查询操" prop="fireProgram20">
          <el-input v-model="form.fireProgram20" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '拉梯与钩梯联用操'">
          <el-form-item label="拉梯与钩梯联用操" prop="fireProgram21">
          <el-input v-model="form.fireProgram21" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '车辆操作'">
          <el-form-item label="车辆操作" prop="fireProgram22">
          <el-input v-model="form.fireProgram22" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '十五米拉梯架设操'">
          <el-form-item label="十五米拉梯架设操" prop="fireProgram23">
          <el-input v-model="form.fireProgram23" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '枪炮协同操'">
          <el-form-item label="枪炮协同操" prop="fireProgram24">
          <el-input v-model="form.fireProgram24" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '片图绘制'">
          <el-form-item label="片图绘制" prop="fireProgram25">
          <el-input v-model="form.fireProgram25" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '60米肩梯架设操'">
          <el-form-item label="60米肩梯架设操" prop="fireProgram26">
          <el-input v-model="form.fireProgram26" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        
        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '绳结制作操'">
          <el-form-item label="绳结制作操" prop="fireProgram27">
          <el-input v-model="form.fireProgram27" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '三盘水带连接操'">
          <el-form-item label="三盘水带连接操" prop="fireProgram28">
          <el-input v-model="form.fireProgram28" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '楼层火灾内攻操'">
          <el-form-item label="楼层火灾内攻操" prop="fireProgram29">
          <el-input v-model="form.fireProgram29" placeholder="请输入（数字类型）成绩" @change="thirtyGrades" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '挂钩提上四楼'">
          <el-form-item label="挂钩提上四楼" prop="fireProgram30">
          <el-input v-model="form.fireProgram30" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '车辆引导'">
          <el-form-item label="车辆引导" prop="fireProgram31">
          <el-input v-model="form.fireProgram31" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '无人机侦察操'">
          <el-form-item label="无人机侦察操" prop="fireProgram32">
          <el-input v-model="form.fireProgram32" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '地下有限空间救人操'">
          <el-form-item label="地下有限空间救人操" prop="fireProgram33">
          <el-input v-model="form.fireProgram33" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '车载炮出水'">
          <el-form-item label="车载炮出水" prop="fireProgram34">
          <el-input v-model="form.fireProgram34" placeholder="请输入（数字类型）成绩" />
        </el-form-item>
        </div>

        <div v-for="(item,index) in dynamicForm" :key="index" v-show="item.programName == '四节吸水管连接操'">
          <el-form-item label="四节吸水管连接操" prop="fireProgram35">
          <el-input v-model="form.fireProgram35" placeholder="请输入（数字类型）成绩" @change="thirtySixGrades" />
        </el-form-item>
        </div>

        <el-form-item label="录入时间" prop="entryDate">
        <el-date-picker clearable
          v-model="form.entryDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择录入时间">
        </el-date-picker>
      </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" v-show="show" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listFirefighterFireTable, getFirefighterFireTable, delFirefighterFireTable,
   addFirefighterFireTable, updateFirefighterFireTable,dynamicInput,getFirefighterIdCard,getNameAge } from "@/api/firefighterFireTable/FirefighterFireTable";

export default {
  name: "FirefighterFireTable",
  data() {
    return {
      dynamicForm:{},
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 灭火救援岗位技能科目训练登记表格数据
      FirefighterFireTableList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        firefighterName: null,
        fireProgram:  null,
        fireProgram1: null,
        fireProgram2: null,
        fireProgram3: null,
        fireProgram4: null,
        fireProgram5: null,
        fireProgram6: null,
        fireProgram7: null,
        fireProgram8: null,
        fireProgram9: null,
        fireProgram10: null,
        fireProgram11: null,
        fireProgram12: null,
        fireProgram13: null,
        fireProgram14: null,
        entryDate: null,
        fireProgram15: null,
        fireProgram16: null,
        fireProgram17: null,
        fireProgram18: null,
        fireProgram19: null,
        fireProgram20: null,
        fireProgram21: null,
        fireProgram22: null,
        fireProgram23: null,
        fireProgram24: null,
        fireProgram25: null,
        fireProgram26: null,
        fireProgram27: null,
        fireProgram28: null,
        fireProgram29: null,
        fireProgram30: null,
        fireProgram31: null,
        fireProgram32: null,
        fireProgram33: null,
        fireProgram34: null,
        fireProgram35: null
      },
      show:true,
      // 表单参数
      form: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        firefighterName: null,
        fireProgram:  0,
        fireProgram1: 0,
        fireProgram2: 0,
        fireProgram3: 0,
        fireProgram4: 0,
        fireProgram5: 0,
        fireProgram6: 0,
        fireProgram7: 0,
        fireProgram8: 0,
        fireProgram9: 0,
        fireProgram10: 0,
        fireProgram11: 0,
        fireProgram12: 0,
        fireProgram13: 0,
        fireProgram14: 0,
        entryDate: null,
        fireProgram15: 0,
        fireProgram16: 0,
        fireProgram17: 0,
        fireProgram18: 0,
        fireProgram19: 0,
        fireProgram20: 0,
        fireProgram21: 0,
        fireProgram22: 0,
        fireProgram23: 0,
        fireProgram24: 0,
        fireProgram25: 0,
        fireProgram26: 0,
        fireProgram27: 0,
        fireProgram28: 0,
        fireProgram29: 0,
        fireProgram30: 0,
        fireProgram31: 0,
        fireProgram32: 0,
        fireProgram33: 0,
        fireProgram34: 0,
        fireProgram35: 0
      },
      // 表单校验
      rules: {
        
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    fen(e){
      return e + ' | ' + e + '分'
    },
    ge(e){
      return Number(e.match(/\d+/)[0]);
    },
    thirtySixGrades(e){
      const grades = this.ge(e)
      console.log("分：",grades)
      if(grades >= 46){
        this.form.fireProgram35 = e + ' | ' + 60 + '分'
      }else if(grades >= 42){
        this.form.fireProgram35 = e + ' | ' + 65 + '分'
      }else if(grades >= 40){
        this.form.fireProgram35 = e + ' | ' + 70 + '分'
      }else if(grades >= 38){
        this.form.fireProgram35 = e + ' | ' + 75 + '分'
      }else if(grades >= 36){
        this.form.fireProgram35 = e + ' | ' + 80 + '分'
      }else if(grades >= 34){
        this.form.fireProgram35 = e + ' | ' + 85 + '分'
      }else if(grades >= 32){
        this.form.fireProgram35 = e + ' | ' + 90 + '分'
      }else if(grades >= 30){
        this.form.fireProgram35 = e + ' | ' + 95 + '分'
      }else{
        this.form.fireProgram35 = e + ' | ' + 100 + '分'
      }
    },
    thirtyGrades(e){
      const grades = this.ge(e)
      if(grades >= 46){
        this.form.fireProgram29 = e + ' | ' + 60 + '分'
      }else if(grades >= 42){
        this.form.fireProgram29 = e + ' | ' + 65 + '分'
      }else if(grades >= 40){
        this.form.fireProgram29 = e + ' | ' + 70 + '分'
      }else if(grades >= 38){
        this.form.fireProgram29 = e + ' | ' + 75 + '分'
      }else if(grades >= 35){
        this.form.fireProgram29 = e + ' | ' + 80 + '分'
      }else if(grades >= 34){
        this.form.fireProgram29 = e + ' | ' + 85 + '分'
      }else if(grades >= 32){
        this.form.fireProgram29 = e + ' | ' + 90 + '分'
      }else if(grades >= 30){
        this.form.fireProgram29 = e + ' | ' + 95 + '分'
      }else if(grades >= 28){
        this.form.fireProgram29 = e + ' | ' + 100 + '分'
      }else{
        this.form.fireProgram29 = e + ' | ' + 100 + '分'
      }
    },
    seventeenGrades(e){
      if(e == '优秀'){
        this.form.fireProgram16 = e + ' | ' + 100 + '分'
      }else if(e == '良好'){
        this.form.fireProgram16 = e + ' | ' + 80 + '分'
      }else if(e == '合格'){
        this.form.fireProgram16 = e + ' | ' + 60 + '分'
      }else{
        this.form.fireProgram16 = e + ' | ' + 59 + '分'
      }
    },
    nineteenGrades(e){
      if(e == '优秀'){
        this.form.fireProgram18 = e + ' | ' + 100 + '分'
      }else if(e == '良好'){
        this.form.fireProgram18 = e + ' | ' + 80 + '分'
      }else if(e == '合格'){
        this.form.fireProgram18 = e + ' | ' + 60 + '分'
      }else{
        this.form.fireProgram18 = e + ' | ' + 59 + '分'
      }
    },
    // getFirefighterIdCard(nameId) {
		// 		console.log("获取证件号：", nameId)
		// 		getFirefighterIdCard(nameId).then(res => {
		// 			console.log("证件号：", res)
		// 			this.form.firefighterName = res.data.name
		// 		})
		// 	},
    getDynamicInput(e){
      console.log("消防员证件号:",e)
      dynamicInput(e).then(res => {
        console.log("返回的消防员录入成绩：", res.data);
        this.dynamicForm = res.data.dynamicInputVos;
        this.form.firefighterName = res.data.nameAndAge.name
      });
    },
    /** 查询灭火救援岗位技能科目训练登记列表 */
    getList() {
      this.loading = true;
      listFirefighterFireTable(this.queryParams).then(response => {
        this.FirefighterFireTableList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        userId: null,
        firefighterName: null,
        fireProgram:  null,
        fireProgram1: null,
        fireProgram2: null,
        fireProgram3: null,
        fireProgram4: null,
        fireProgram5: null,
        fireProgram6: null,
        fireProgram7: null,
        fireProgram8: null,
        fireProgram9: null ,
        fireProgram10: null,
        fireProgram11: null,
        fireProgram12: null,
        fireProgram13: null,
        fireProgram14: null,
        entryDate: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        fireProgram15: null,
        fireProgram16: null,
        fireProgram17: null,
        fireProgram18: null,
        fireProgram19: null,
        fireProgram20: null,
        fireProgram21: null,
        fireProgram22: null,
        fireProgram23: null,
        fireProgram24: null,
        fireProgram25: null,
        fireProgram26: null,
        fireProgram27: null,
        fireProgram28: null,
        fireProgram29: null,
        fireProgram30: null,
        fireProgram31: null,
        fireProgram32: null,
        fireProgram33: null,
        fireProgram34: null,
        fireProgram35: null,
        fireProgram36: null,
        fireProgram37: null,
        fireProgram38: null,
        fireProgram39: null,
        fireProgram40: null,
        fireProgram41: null,
        fireProgram42: null,
        fireProgram43: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加灭火救援岗位技能科目训练登记";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getFirefighterFireTable(id).then(response => {
        this.form = response.data;
        // this.form.firefighterIdCard = response.data.userId
        this.open = true;
        this.title = "修改灭火救援岗位技能科目训练登记";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateFirefighterFireTable(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            this.show = false
            this.form.fireProgram = this.fen(this.form.fireProgram)
            // console.log("this.form:", this.form)
            this.form.fireProgram1 = this.fen(this.form.fireProgram1)
            this.form.fireProgram2 = this.fen(this.form.fireProgram2)
            this.form.fireProgram3 = this.fen(this.form.fireProgram3)
            this.form.fireProgram4 = this.fen(this.form.fireProgram4)
            this.form.fireProgram5 = this.fen(this.form.fireProgram5)
            this.form.fireProgram6 = this.fen(this.form.fireProgram6)
            this.form.fireProgram7 = this.fen(this.form.fireProgram7)
            this.form.fireProgram8 = this.fen(this.form.fireProgram8)
            this.form.fireProgram9 = this.fen(this.form.fireProgram9)
            this.form.fireProgram10 = this.fen(this.form.fireProgram10)
            this.form.fireProgram11 = this.fen(this.form.fireProgram11)
            this.form.fireProgram12 = this.fen(this.form.fireProgram12)
            this.form.fireProgram13 = this.fen(this.form.fireProgram13)
            this.form.fireProgram14 = this.fen(this.form.fireProgram14)
            this.form.fireProgram15 = this.fen(this.form.fireProgram15)
            // // this.form.fireProgram16 = this.fen(this.form.fireProgram16)
            this.seventeenGrades(this.form.fireProgram16)
            this.form.fireProgram17 = this.fen(this.form.fireProgram17)
            // this.form.fireProgram18 = this.fen(this.form.fireProgram18)
            this.nineteenGrades(this.form.fireProgram18)
            this.form.fireProgram19 = this.fen(this.form.fireProgram19)
            this.form.fireProgram20 = this.fen(this.form.fireProgram20)
            this.form.fireProgram21 = this.fen(this.form.fireProgram21)
            this.form.fireProgram22 = this.fen(this.form.fireProgram22)
            this.form.fireProgram23 = this.fen(this.form.fireProgram23)
            this.form.fireProgram24 = this.fen(this.form.fireProgram24)
            this.form.fireProgram25 = this.fen(this.form.fireProgram25)
            this.form.fireProgram26 = this.fen(this.form.fireProgram26)
            this.form.fireProgram27 = this.fen(this.form.fireProgram27)
            this.form.fireProgram28 = this.fen(this.form.fireProgram28)
            // // this.form.fireProgram29 = this.fen(this.form.fireProgram29)
            // this.thirtyGrades(this.form.fireProgram29)
            this.form.fireProgram30 = this.fen(this.form.fireProgram30)
            this.form.fireProgram31 = this.fen(this.form.fireProgram31)
            this.form.fireProgram32 = this.fen(this.form.fireProgram32)
            this.form.fireProgram33 = this.fen(this.form.fireProgram33)
            this.form.fireProgram34 = this.fen(this.form.fireProgram34)
            // // this.form.fireProgram35 = this.fen(this.form.fireProgram35)
            // this.thirtySixGrades(this.form.fireProgram35)
            this.form.fireProgram36 = this.fen(this.form.fireProgram36)
            this.form.fireProgram37 = this.fen(this.form.fireProgram37)
            this.form.fireProgram38 = this.fen(this.form.fireProgram38)
            this.form.fireProgram39 = this.fen(this.form.fireProgram39)
            this.form.fireProgram40 = this.fen(this.form.fireProgram40)
            this.form.fireProgram41 = this.fen(this.form.fireProgram41)
            this.form.fireProgram42 = this.fen(this.form.fireProgram42)
            this.form.fireProgram43 = this.fen(this.form.fireProgram43)
            console.log("form:",this.form)
            addFirefighterFireTable(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.show = true
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除灭火救援岗位技能科目训练登记编号为"' + ids + '"的数据项？').then(function() {
        return delFirefighterFireTable(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/FirefighterFireTable/export', {
        ...this.queryParams
      }, `FirefighterFireTable_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
